<?
// UNIT TEST API  BY 3T SOFTWARE

$test_true;
$test_false;
$report = '';


function assertGreaterThan($Expect , $R)
{
    global $test_true;
    global $test_false;
    
    if ($Expect < $R)
    {
        $report .= '<font color="blue">';
        $report .= "<b>TEST OK </b><br />";
        $report .= "Mong Cho: > $Expect <br>";
        $report .= "Thuc Te : $R";
        $report .= '</font><br><br>';
        echo $report;
        $test_true++;
        return true;
        
    }
    else
    {
        $report .= '<font color="red">';
        $report .= "<br><b>TEST FALSE </b><br />";
        $report .= "Mong Cho: > $Expect <br>";
        $report .= "Thuc Te : $R";
        $report .= '</font><br><br>';
        echo $report;
        $test_false++;
        return false;
    }
}

function assertEquals($Expect , $R)
{
     global $test_true;
    global $test_false;
    
    if ($Expect == $R)
    {
        $report .= '<font color="blue">';
        $report .= "<b>TEST OK </b><br />";
        $report .= "Mong Cho: $Expect <br>";
        $report .= "Thuc Te : $R";
        $report .= '</font><br><br>';
        echo $report;
        $test_true++;
        return true;
        
    }
    else
    {
        $report .= '<font color="red">';
        $report .= "<br><b>TEST FALSE </b><br />";
        $report .= "Mong Cho: $Expect <br>";
        $report .= "Thuc Te : $R";
        $report .= '</font><br><br>';
        echo $report;
         $test_false++;
        return false;
    }
}

function assertNotEquals($Expect , $R)
{
     global $test_true;
    global $test_false;
    
    if ($Expect != $R)
    {
        $report .= '<font color="blue">';
        $report .= "<b>TEST OK </b><br />";
        $report .= "Mong Cho: $Expect <br>";
        $report .= "Thuc Te : $R";
        $report .= '</font><br><br>';
        echo $report;
        $test_true++;
        return true;
        
    }
    else
    {
        $report .= '<font color="red">';
        $report .= "<br><b>TEST FALSE </b><br />";
        $report .= "Mong Cho: $Expect <br>";
        $report .= "Thuc Te : $R";
        $report .= '</font><br><br>';
        echo $report;
         $test_false++;
        return false;
    }
}

function assertTrue($R)
{

     global $test_true;
    global $test_false;
    
    if ($R == true)
    {
        $report .= '<font color="blue">';
        $report .= "<b>TEST OK </b><br />";
        $report .= "IS TRUE <br>";
        $report .= '</font><br><br>';
        echo $report;
        $test_true++;
        return true;
        
    }
    else
    {
        $report .= '<font color="red">';
        $report .= "<br><b>TEST FALSE </b><br />";
        $report .= "IS FALSE<br>";
        $report .= '</font><br><br>';
        echo $report;
        $test_false++;
        return false;
    }
}



function assertFalse($R)
{

     global $test_true;
    global $test_false;
    
    if ($R == false)
    {
        $report .= '<font color="blue">';
        $report .= "<br><b>TEST OK </b><br />";
        $report .= "IS FALSE <br>";
        $report .= '</font><br><br>';
        echo $report;
        $test_true++;
        return true;
        
    }
    else
    {
        $report .= '<font color="red">';
        $report .= "<br><b>TEST FALSE </b><br />";
        $report .= "IS TRUE<br>";
        $report .= '</font><br><br>';
        echo $report;
        $test_false++;
        return false;
    }
}



function assertExist($R)
{

     global $test_true;
    global $test_false;
    
    if (isset($R))
    {
        $report .= '<font color="blue">';
        $report .= "<br><b>TEST OK </b><br />";
        $report .= "IS EXIST<br>";
        $report .= '</font><br><br>';
        echo $report;
        $test_true++;
        return true;
        
    }
    else
    {
        $report .= '<font color="red">';
        $report .= "<br><b>TEST FALSE </b><br />";
        $report .= "IS NOT EXIST<br>";
        $report .= '</font><br><br>';
        echo $report;
        $test_false++;
        return false;
    }
}




function assertNotExist($R)
{

     global $test_true;
    global $test_false;
    
    if (!isset($R))
    {
        $report .= '<font color="blue">';
        $report .= "<br><b>TEST OK </b><br />";
        $report .= "IS NOT EXIST<br>";
        $report .= '</font><br><br>';
        echo $report;
        $test_true++;
        return true;
        
    }
    else
    {
        $report .= '<font color="red">';
        $report .= "<br><b>TEST FALSE </b><br />";
        $report .= "IS EXIST<br>";
        $report .= '</font><br><br>';
        echo $report;
        $test_false++;
        return false;
    }
}









//assertEquals(1,2);

?>



<font color="blue">
</font>
